package com.springboot.springboot4.Servlet;


import lombok.extern.slf4j.Slf4j;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * @ClassName:
 * @author: CKC
 * @DateTime: 2021/1/30 14:36
 */
@Slf4j
@WebFilter(urlPatterns = {"/css/*","/images/*"})
public class MyFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        
        log.info("MyFilter 初始化完成");
    }
    
    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        log.info("MyFilter 工作");
        
        chain.doFilter(request, response);
    }
    
    @Override
    public void destroy() {
        log.info("MyFilter 销毁了");
    }
}
